home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19980901-19981211 / 000146_news@newsmaster….columbia.edu _Tue Oct 13 20:29:27 1998.msg < prev    next >
Internet Message Format  |  1998-12-10  |  3KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id UAA25872
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Tue, 13 Oct 1998 20:29:26 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id UAA14500
  7.     for kermit.misc@watsun; Tue, 13 Oct 1998 20:29:25 -0400 (EDT)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!jaltman
  9. From: jaltman@watsun.cc.columbia.edu (Jeffrey Altman)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Kermit script
  12. Date: 14 Oct 1998 00:29:23 GMT
  13. Organization: Columbia University
  14. Lines: 61
  15. Message-ID: <700r93$kgj$1@apakabar.cc.columbia.edu>
  16. References: <VqRU1.139$fE6.283188@ptah.visi.com>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:9337
  19.  
  20. In article <VqRU1.139$fE6.283188@ptah.visi.com>,
  21. Mike Ekholm  <ekholm@nospam.visi.com> wrote:
  22. : Hello.
  23. : I am attempting to write a simple script to sent the character "s" to the
  24. : serial port, then recive the the output from the serial port. I have
  25. : gotten the sending to work, but the recive part is not working. I have
  26. : tried the "input" command with no luck. if I do the script interactivly,
  27. : then do a "connect" I recive all the data I want, without doing anything
  28. : further. but the connect command is not very fun to use when doing this
  29. : non interactivly. What is the best way to have all the data recived from
  30. : the serial port go to stdout then have the script/kermit terminate?
  31. : What I am doing is monitoring a old UPS, which sends the stats out, when
  32. : it recives a "s" on the serial port. here is what I got from the
  33. : interactive session:
  34. :    [/usr/home/ekholm] C-Kermit>set line /dev/cuaa0
  35. :    [/usr/home/ekholm] C-Kermit> set speed 1200
  36. :    /dev/cuaa0, 1200 bps
  37. :    [/usr/home/ekholm] C-Kermit>output s\13
  38. :    [/usr/home/ekholm] C-Kermit>output s\13     
  39. :    [/usr/home/ekholm] C-Kermit>connect
  40. :    => s
  41. :    ---- MICRO-FERRUPS SYSTEM STATUS ----
  42. :    INVERTER:  OFF
  43. :    AC VOLTS OUT     121
  44. :    AC AMPS OUT      3.76
  45. :    OUTPUT LOAD (VA) 455
  46. :    AC VOLTS IN      121
  47. :    FREQUENCY        59.97
  48. :    BATTERY VOLTS    13.5
  49. :    HEATSINK (C)     032
  50. :    # POWER OUTAGES  00090
  51. :    INVERTER MINUTES 00170.2
  52. :    SYSTEM HOURS     032345
  53. :    # OVERLOADS      0080
  54. :   PROJECTED BACKUP TIME AVAILABLE AT PRESENT LOAD:  0025  MINUTES
  55. :    => 
  56. : So what I want to do is get everthing after the connect command, then have
  57. : kermit terminate. I have tried the input command, but i can only get that
  58. : to work like 'expect'
  59. : Thanks,
  60. :  -Mike
  61.  
  62. SET LINE /dev/cuaa0
  63. SET SPEED 1200
  64. SET CARRIER-WATCH OFF
  65. SET INPUT ECHO ON
  66. OUTPUT s\13
  67. INPUT 10 some-string-that-will-never-come
  68. SET PORT
  69. EXIT
  70.  
  71.     Jeffrey Altman * Sr.Software Designer * Kermit-95 for Win32 and OS/2
  72.                  The Kermit Project * Columbia University
  73.               612 West 115th St #716 * New York, NY * 10025
  74.   http://www.kermit-project.org/k95.html * kermit-support@kermit-project.org